package com.winz.cultureapp.activity;

import android.net.Uri;

import com.winz.cultureapp.R;
import com.winz.cultureapp.base.BaseAppCompatActivity;

import butterknife.BindView;
import cn.jzvd.JzvdStd;

public class PlayerActivity extends BaseAppCompatActivity {
    @BindView(R.id.videoplayer)
    JzvdStd videoplayer;

    @Override
    protected int contentView() {
        return R.layout.activity_player;
    }

    @Override
    protected void initViews() {
        // http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4
        videoplayer.setUp("http://test253.maoming.gov.cn:80/image/a6568b1159bd43e985947ba9eabe36e3.mp4"
                , "饺子闭眼睛", videoplayer.SCREEN_WINDOW_NORMAL);
        videoplayer.thumbImageView.setImageURI(Uri.parse("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640"));
    }

    @Override
    public void onBackPressed() {
        if (videoplayer.backPress()) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    protected void onPause() {
        super.onPause();
        videoplayer.releaseAllVideos();
    }

}
